package com.act.moudles.baseAct.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * (OnlineDeploy)表实体类
 *
 * @author makejava
 * @since 2023-05-10 00:05:24
 */
@Data
@TableName("s_online_deploy")
public class OnlineDeploy {
    //主键
    @TableId(type = IdType.AUTO)
    private Long deId;
    //更新次数
    private Integer updCounts;
    //删除标志（0代表存在 2代表删除）
    private Integer delFlag;
    //创建者
    private Long createBy;
    //创建时间
    private Date createTime;
    //更新者
    private Long updateBy;
    //更新时间
    private Date updateTime;
    //备注
    private String remark;
    //定义Id
    private String procdefId;
    //定义key
    private String procdefKey;
    //用户调用key
    private String userProcdefKey;
    //关联id
    private Long userId;
    //组织ID
    private Long userOrgId;
    //用户名
    private String userName;
    //多租户标识
    private String tenantId;
    //部署名称
    private String depeloyName;
    //定义描述
    private String procdefDes;
    //解析结果
    private String anlRes;
    //bpmn文件路径
    private String bpmnPath;
    //图片路径
    private String pngPath;

    private String bpmnFileName;



    public LambdaQueryWrapper<OnlineDeploy> query(){
        LambdaQueryWrapper<OnlineDeploy> query = new LambdaQueryWrapper<>();
        query.like(StringUtils.isNotEmpty(depeloyName),OnlineDeploy::getDepeloyName,depeloyName);
        query.like(StringUtils.isNotEmpty(userProcdefKey),OnlineDeploy::getUserProcdefKey,userProcdefKey);
        query.like(StringUtils.isNotEmpty(userName),OnlineDeploy::getUserName,userName);
        query.eq(userId != null,OnlineDeploy::getUserId,userId);
        query.eq(StringUtils.isNotEmpty(bpmnFileName),OnlineDeploy::getBpmnFileName,bpmnFileName);
        query.eq(StringUtils.isNotEmpty(tenantId),OnlineDeploy::getTenantId,tenantId);
        return query;
    }

    }

